#ifndef __UI_COMMANDS_H__
#define __UI_COMMANDS_H__ 1

#define DEFAULT_UI_PORT 8960

/* duplex-commands defined here
 * interpretation up to the using part
 *
 */

enum ECommandId {
	/**
	 * common command structur payload = command (1 byte) + optional payload
	 *
	 * fields: |  1  |       0 - n bytes    |
	 *         | CMD | < optional payload > |
	 */

	COMMAND_CLOSE_CONNECTION = 1,

	/**
	 * fields: |  1  |
	 *         | CMD |
	 *
	 */
	COMMAND_START,

	/**
	 * fields: |  1  |
	 *         | CMD |
	 *
	 */
	COMMAND_TRANSMIT_CONFIG,

	/**
	 * fields: |  1  |          2 - n bytes          |
	 *         | CMD | < section >:< key >=< value : |
	 *
	 */
	COMMAND_TRANSMIT_CONFIG_START,

	/**
	 * fields: |  1  |
	 *         | CMD |
	 *
	 */
	COMMAND_TRANSMIT_CONFIG_END,

	/**
	 * fields: |  1  |
	 *         | CMD |
	 *
	 */
	COMMAND_RECEIVE_CONFIG_START,

	/**
	 * fields: |  1  |
	 *         | CMD |
	 *
	 */
	COMMAND_RECEIVE_CONFIG_END,

	/**
	 * fields: |  1  |   0 - n bytes    |
	 *         | CMD | < section name > |
	 *
	 */
	COMMAND_RECEIVE_CONFIG_SECTION,

	/**
	 * fields: |  1  |          2 - n bytes          |
	 *         | CMD | < section >:< key >=< value > |
	 *
	 */
	COMMAND_RECEIVE_CONFIG_KEY,

	/**
	 * fields: |  1  |   1   | 0 - n bytes |
	 *         | CMD | LEVEL |     MSG     |
	 *
	 * LEVEL the log level (as defined by ELogLevel; see below)
	 * MSG the logging message
	 */
	COMMAND_TRANSMIT_INFO,

	/**
	 * fields: |  1  |  4   |  4   |
	 *         | CMD | USED | SIZE |
	 *
	 * USED used space from extract ring buffer (unit: byte)
	 * SIZE max size of extract ring buffer (unit: byte)
	 */
	COMMAND_EXTRACT_BUFFER_INFO,

	/**
	 * fields: |  1  |   4    |
	 *         | CMD | LENGTH |
	 *
	 */
	COMMAND_FRAME_SEND_LENGTH,

	/**
	 * fields: |  1  |   4    |   1   |
	 *         | CMD | LENGTH | ERROR |
	 *
	 *
	 */
	COMMAND_FRAME_RECV_LENGTH,

	/**
	 * fields: |  1  |   4    |
	 *         | CMD | LENGTH |
	 *
	 */
	COMMAND_PACKET_SEND_LENGTH,

	/**
	 * fields: |  1  |   4    |   1   |
	 *         | CMD | LENGTH | ERROR |
	 *
	 *
	 */
	COMMAND_PACKET_RECV_LENGTH,

	/**
	 * fields: |  1  |  1  |  1  |   4    |   1    |
	 *         | CMD | ID  | ACK | LENGTH | REPLAY |
	 */
	COMMAND_STREAM_SEND_INFO,
	COMMAND_STREAM_RECV_INFO,

	/**
	 * fields: |  1  | n bytes |
	 *         | CMD | PAYLOAD |
	 *
	 * PAYLOAD stream payload which is send/recv to steg io. Can
	 *         be 1 to n bytes.
	 */
	COMMAND_STREAM_SEND_DATA,
	COMMAND_STREAM_RECV_DATA,

	/**
	 * fields: |  1  | n bytes |
	 *         | CMD | PAYLOAD |
	 *
	 * PAYLOAD protocol payload which is send/recv to GUI. Can
	 *         be 1 to n bytes.
	 */
	COMMAND_PROTOCOL_WRITE_DATA,
	COMMAND_PROTOCOL_READ_DATA,

	/**
	 * fields: |  1  |
	 *         | CMD |
	 */
	COMMAND_PROTOCOL_OPEN,
	COMMAND_PROTOCOL_CLOSE,

	/**
	 * fields: |  1  |  4   |  4   |
	 *         | CMD | READ | SIZE |
	 *
	 * READ already read bytes (unit: byte)
	 * SIZE size of current read protocol buffer (unit: byte)
	 */
	COMMAND_PROTOCOL_READ_FEEDBACK,

	/**
	 * fields: |  1  |  1  |
	 *         | CMD | AMP |
	 *
	 * AMP
	 */
	COMMAND_AMP_EMBED,
	COMMAND_AMP_EXTRACT,

	/**
	 * fields: |  1  |  4  |
	 *         | CMD | AMP |
	 *
	 */
	COMMAND_NOISE_RECV_AMP,
};

enum ELogLevel
{   
	LOG_DEBUG = 1,
	LOG_WARN,
	LOG_ERR,
};  


#endif

